<template>
  <div>
    <div class="recommend-title">热销推荐</div>
    <ul>
      <router-link
        tag="li"
        class="item"
        border-bottom
        v-for="item of list"
        :key="item.id"
        :to="'/detail/' + item.id"
      >
        <img class="item-img" :src="item.imgUrl" />

        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>
<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  },
  data () {
    return {
      recommendlist:
        [
          {
            id: '0001',
            imgUrl: 'https://imgs.qunarzz.com/vs_ceph_vs_tts/b662e827-f972-4235-b3f6-bb2a4405628c.jpg_180x120_c282d525.jpg',
            title: '南昌-大理 6天跟团游',
            desc: '错峰特惠 大额满减✈享9重好礼+温泉！洱海吉普游艇+玉龙雪山拉市海+喂红嘴鸥'
          },
          {
            id: '0002',
            imgUrl: 'https://imgs.qunarzz.com/vs_ceph_vs_tts/b662e827-f972-4235-b3f6-bb2a4405628c.jpg_180x120_c282d525.jpg',
            title: '南昌-大理 6天跟团游',
            desc: '错峰特惠 大额满减✈享9重好礼+温泉！洱海吉普游艇+玉龙雪山拉市海+喂红嘴鸥'
          },
          {
            id: '0003',
            imgUrl: 'https://imgs.qunarzz.com/vs_ceph_vs_tts/b662e827-f972-4235-b3f6-bb2a4405628c.jpg_180x120_c282d525.jpg',
            title: '南昌-大理 6天跟团游',
            desc: '错峰特惠 大额满减✈享9重好礼+温泉！洱海吉普游艇+玉龙雪山拉市海+喂红嘴鸥'
          }
        ]
    }
  }
}
</script>
<style lang="stylus" scoped>
@import '~styles/mixins.styl';

.recommend-title {
  margin-top: 0.2rem;
  line-height: 0.8rem;
  background: #eee;
  text-indent: 0.2rem;
}

.item {
  overflow: hidden;
  display: flex;
  height: 1.8rem;
  width: 100%;
}

.item-img {
  height: 1.6rem;
  width: 2.4rem;
  padding: 0.1rem;
}

.item-info {
  flex: 1;
  padding: 0.1rem;
  min-width: 0;
  ellipsis();
}

.item-title {
  line-height: 0.54rem;
  font-size: 0.28rem;
  ellipsis();
}

.item-desc {
  line-height: 0.4rem;
  font-size: 0.28rem;
  color: #aaa;
  ellipsis();
}

.item-button {
  margin-top: 0.2rem;
  background-color: #ff9300;
  padding: 0 0.1rem;
  border-radius: 0.1rem;
}
</style>
